package com.linwen.dataStructure.tree;

import java.util.Arrays;
import java.util.LinkedList;
import org.junit.Test;

public class MyBinaryTreeTest {
	@Test
	public void test1() {
		LinkedList<Integer> inputList = new LinkedList<Integer>
		(Arrays.asList(new Integer[] {3,2,9,null,null,10,null,null,8,null,4}));
		new BinaryTree();
		TreeNode treeNode = BinaryTree.creatBinaryTree(inputList);
		System.out.println("前序遍历");
		BinaryTree.preOrderTreavel(treeNode);
		System.out.println();
		BinaryTree.stackPreOrderTreavel(treeNode);
		System.out.println();
		System.out.println("中序遍历");
		BinaryTree.inderOrderTreavel(treeNode);
		System.out.println();
		System.out.println("后续遍历");
		BinaryTree.postOrderTreavel(treeNode);
		System.out.println();
		System.out.println("层次遍历");
		BinaryTree.levelOrderTreavel(treeNode);
		
	}
}
